import java.util.Scanner;

/**
 * 美团面试 不会写Scanner ！！！！
 */
public class ScannerTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[][] arr = new int[N][M];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < M; j++) {
                arr[i][j] = sc.nextInt();
            }
        }
        int i = N - 1;
        int j = 0;
        while (i >= 0 && j < M) {
            if (arr[i][j] > K){
                i--;
            }else if (arr[i][j] < K){
                j++;
            }else {
                System.out.println("yes");
            }
        }
        System.out.println("No");
    }
}
